﻿using AnesSystem.Models;
using AnesSystem.Services;
using AnesSystem.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;


namespace AnesSystem.Controls
{
    /// <summary>
    /// UrgentOperCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class UrgentOperDialogWin : BaseToolWindow
    {
        #region Variables

        #endregion

        #region Constructor
        public UrgentOperDialogWin()
        {
            InitializeComponent();
            this.DataContext = UrgentOperDialogWinViewModel.Instance;
            UrgentOperDialogWinViewModel.Instance.SerchZyhSuccessed += Instance_SerchZyhSuccessed;
            Collapsed += UrgentOperDialogWin_Collapsed;
        }
        #endregion

        #region Properties

        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        #endregion

        #region Public/Protected Methods

        #endregion

        #region EventHandlers

        private void Instance_SerchZyhSuccessed(object sender, EventArgs e)
        {
            Dispatcher.Invoke(delegate
            {
                MainPageCommonViewModel.Instance.NavigateTo("AnesRecordCtrl", false);
            });
        }

        private void UrgentOperDialogWin_Collapsed(object sender, EventArgs e)
        {
            this.CloseWin(true);
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string commond = (sender as Button).Tag.ToString();
            UrgentOperDialogWinViewModel.Instance.Excute(commond);
        }
        #endregion
    }
}
